package com.zzb.demo.mapper;

import com.zzb.demo.model.domain.Student;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @Author zzb
 * @Date 2024/12/12 22:00
 * @Version 1.0
 * @description
 */
@Mapper
public interface StudentMapper {

    @Select(value = "select * from student where id = #{student.id}")
    List<Student> getStudentsByCondition(@Param("student") Student student);

    @Update(value = "update student set name = #{student.name},age = #{student.age},cid = #{student.cid} where id = #{student.id}")
    int updateStudent(@Param("student") Student student);
    @Insert(value = "insert into student values (#{student.id},#{student.name},#{student.age},#{student.cid})")
    int insertStudent(@Param("student") Student student);

    @Delete(value = "delete from student where id = #{student.id}")
    int delStudent(@Param("student") Student student);

}
